from flask.json.provider import DefaultJSONProvider
import json
class Config:
    # 数据库配置
    SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:hw123456@localhost:3306/python'
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    SECRET_KEY = 'COOLPAI'
    UPLOAD_FOLDER = 'uploads'
    PAGE_SIZE = 10


class CustomJSONProvider(DefaultJSONProvider):
    def dumps(self, obj, **kwargs):
        kwargs['ensure_ascii'] = False  # 确保中文不被转义
        return json.dumps(obj, **kwargs)
